package com.itsu.compoment.rabbitmq;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.amqp.rabbit.support.CorrelationData;
import org.springframework.stereotype.Component;

/**
 * @author 苏犇
 * @create time 2019/12/8 16:44
 */
@Component
@Slf4j
public class BootMsgConfirm implements RabbitTemplate.ConfirmCallback {
    @Override
    public void confirm(CorrelationData correlationData, boolean ack, String cause) {
        log.info("correlationData:{}", correlationData);
        if (!ack) {
            log.warn(cause);
        }
    }
}
